package cn.sc.allinpay.allfavour.business.common.data;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * description：会员优惠
 * author：pany
 * on 2018/8/2 16:24
 */
public class RightData implements Parcelable {
    private EveryReduceData everyReduce;//梯度满减
    private AssignReduceData assignReduce;//指定满减
    private DiscountData discount;//折扣

    private String noDiscountAmt;//不参与优惠的金额
    private boolean isUse = true;//是否使用会员权益，默认使用

    public RightData() {

    }

    protected RightData(Parcel in) {
        everyReduce = in.readParcelable(EveryReduceData.class.getClassLoader());
        assignReduce = in.readParcelable(AssignReduceData.class.getClassLoader());
        discount = in.readParcelable(DiscountData.class.getClassLoader());
        noDiscountAmt = in.readString();
        isUse = in.readByte() != 0;
    }

    public EveryReduceData getEveryReduce() {
        return everyReduce;
    }

    public void setEveryReduce(EveryReduceData everyReduce) {
        this.everyReduce = everyReduce;
    }

    public AssignReduceData getAssignReduce() {
        return assignReduce;
    }

    public void setAssignReduce(AssignReduceData assignReduce) {
        this.assignReduce = assignReduce;
    }

    public DiscountData getDiscount() {
        return discount;
    }

    public void setDiscount(DiscountData discount) {
        this.discount = discount;
    }

    public String getNoDiscountAmt() {
        return noDiscountAmt;
    }

    public void setNoDiscountAmt(String noDiscountAmt) {
        this.noDiscountAmt = noDiscountAmt;
    }

    public boolean isUse() {
        return isUse;
    }

    public void setUse(boolean use) {
        isUse = use;
    }

    public static final Creator<RightData> CREATOR = new Creator<RightData>() {
        @Override
        public RightData createFromParcel(Parcel in) {
            return new RightData(in);
        }

        @Override
        public RightData[] newArray(int size) {
            return new RightData[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeParcelable(everyReduce, i);
        parcel.writeParcelable(assignReduce, i);
        parcel.writeParcelable(discount, i);
        parcel.writeString(noDiscountAmt);
        parcel.writeByte((byte) (isUse ? 1 : 0));
    }
}
